<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>直播入口页</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.3.0/video-js.min.css" rel="stylesheet">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.3.0/video.min.js"></script>

    <style>

        *
        {
            box-sizing: border-box;
        }
        body,
        html {
            margin: 0px auto;
            padding: 0;
            font-size: 14px;
        }

        .vjs-poster {
            background-size: cover;
        }

        .m-input
        {
            line-height: 40px;
            height: 40px;
            padding: 6px 10px;
            border:1px lightseagreen solid;
        
        }

        .m-input-valid
        {
            border:1px orangered solid;
        }

        .m-btn
        {
            line-height: 40px;
            height: 40px;
            border:1px lightseagreen solid;
            background-color: lightseagreen;
            color: white;
        }

         .m-btn.m-btn-gray
        {
            line-height: 40px;
            height: 40px;
            border:1px lightgray solid;
            background-color: lightgray;
            color: #555;
        }

        .m-btn.active
        {
            background-color:teal;
            border:1px teal solid;
            color: white;
        }

        input
        {
            width: 100%;
            outline: none;
            outline-style: none;
        }

        .container
        {
            padding: 10px;
        }

        .mt_20
        {
            margin-top: 20px;
        }

        .mt_5
        {
            margin-top: 5px;
        }

        

        .info
        {
            line-height: 1em;
            padding: 10px;
            background-color: aliceblue;
            color: #555;
        }

        .none
        {
            display: none;
        }

        .config_textarea
        {
            margin-top: 5px;
            width: 100%;
            outline: none;
            outline-style: none;
        }

        .multi_btn_container .m-btn
        {
            width:48%;
            box-sizing: border-box;
        }

        .fl
        {
            float: left;
        }

         .fr
        {
            float: right;
        }

    </style>
</head>

<body>

    <div class="container">
        <input type="text" placeholder="请输入直播标识,如不需则进入管理员设定的默认直播" class="m-input" id="videoKey" />
        <input type="button" value="进入直播" class=" m-btn mt_20 " id="startPlayer" />
    </div>


    <script src="https://cdn.bootcss.com/zepto/1.2.0/zepto.min.js"></script>
    <script>
        $(function () {
            $('.m-btn').on("touchstart", function () {
                $(this).addClass("active");
            });

            $('.m-btn').on("touchend", function () {
                $(this).removeClass("active");
            })

            $('#startPlayer').on('click', function () {
                var videoKey = $("#videoKey").val() || "";
                console.log(videoKey);
                // if (videoKey == "") {
                //     $("#videoKey").addClass('m-input-valid');
                //     return false;
                // }

                window.location.href = "player.html?videoKey=" + videoKey;

            });

            $('#videoKey').on('focus', function () {
                $("#videoKey").removeClass('m-input-valid');
            });

            $('#videoKey').on('keyup', function (event) {
                if (event.keyCode == "13") {
                    //回车执行查询
                    $('#startPlayer').click();
                }
            });


            $('#adminEntryBtn').on('click', function (event) {

                $("#secret").toggleClass('none');
            });



        });
    </script>
</body>

</html>